<?php
/**
 * @file
 * Creates the 'Facebook' object.
 *
 * Usage:
 *  - A page that wants to use the 'Facebook' object should include/require this
 *    page once and only once.
 *
 * Parameter(s):
 *  - $PATH_COMMON  : Relative path from the calling page to the 'common'
 *                    directory (e.g. '../common/').
 *  - FB_APP_KEY    : The application's Facebook 'API Key'.
 *  - FB_APP_SECRET : The application's Facebook 'Application Secret'.
 *
 * Global variable(s) set:
 *  - $fb : The 'Facebook' object.
 *
 * Global variable(s) unset:
 *  - None.
 *
 * Exception(s):
 *  - Throws an 'Exception' object if creation of the 'Facebook' object fails.
 *
 * This file includes/requires:
 *  - h_facebook.php
 */

// header file(s) ==============================================================
require_once $PATH_COMMON . "php/h_facebook.php";


// global variable(s) ==========================================================
//! The 'Facebook' object.
$fb = null;


// implementation ==============================================================
// create facebook object
$fb = new Facebook(FB_APP_KEY, FB_APP_SECRET);
if (false == isset($fb)) {
  // failed to create facebook object
  throw new Exception(FB_EX_MSG_FACEBOOK);
}
?>
